# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: speps <speps at aur dot archlinux dot org>

pkgname=blop
pkgver=0.2.8
pkgrel=5
pkgdesc="Bandlimited LADSPA Oscillator Plugins"
arch=(loong64 x86_64)
url="http://blop.sourceforge.net/"
license=(GPL)
depends=(glibc)
makedepends=(ladspa)
groups=(
  ladspa-plugins
  pro-audio
)
source=(
  https://downloads.sourceforge.net/project/$pkgname/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.gz
  $pkgname-0.2.8-full_relro.patch
)
sha512sums=('5a1bb2e4ba976dd87f8b34538b3a8d2ed21ba0b8818d4b0a713061aeeae7fd52377477314a758cc7082a932315be8ec99006dfc3f5c9712d8d566852adbf671f'
            '3e55c4fdcd2ed320ce22f539a6913afd2656a956fa26b153c40511ed1b48b24d7a5815f07abfc824d1094c43e4d46ad4a24461390da267d8bab0512f8e320b29')
b2sums=('240d102b5ca7b554e96af8ec927dd88804d6cb4f6a7eb22b5edf4231793747963d80583f345179e9fb891b4160a0587f8fa78a638154d9663da237924f9dc4ea'
        '10f77c883a7bc49fe90d2da8fdda7faaec7ce30ef18b4590098d7a9522b953f1ffb10ee7e3d1172dbb1d3885bcbaf4fd797792287b17f24ba9b3b65ac601ab7c')

prepare() {
  # force LDFLAGS into all the libs to achieve full RELRO
  patch -Np1 -d $pkgname-$pkgver -i ../$pkgname-0.2.8-full_relro.patch
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  make
}

package(){
  make DESTDIR="$pkgdir" install -C $pkgname-$pkgver
  install -vDm 644 $pkgname-$pkgver/{AUTHORS,ChangeLog,NEWS,README,THANKS,TODO} -t "$pkgdir/usr/share/doc/$pkgname/"
}
